using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Easy.Authorization.Models.Mapping
{
    public class Aut_ModelsMap : EntityTypeConfiguration<Aut_Models>
    {
        public Aut_ModelsMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.ModelName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.ModelDispaly)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.ModelUrl)
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("Aut_Models");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.ModelName).HasColumnName("ModelName");
            this.Property(t => t.ModelDispaly).HasColumnName("ModelDispaly");
            this.Property(t => t.ModelUrl).HasColumnName("ModelUrl");
        }
    }
}
